package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpReportsSMSServiceActivityReportPageUtil extends SeleniumPageUtil {
	public final static By RSSAR_SPAN_CUSTOMER = By.id("ctl44_lblCustomer");
	public final static By RSSAR_SPAN_CUSTOMER_REQD = By.xpath("//*[@id='ctl44_tblCustomer']/tbody/tr/td[1]/span[2]");
	public final static By RSSAR_INPUT_CUSTOMER = By.id("ctl44_txtCustomer");
	
	public final static By RSSAR_SPAN_DATE_RANGE = By.id("ctl44_lblDateRange");
	public final static By RSSAR_SPAN_DATE_RANGE_REQD = By.xpath("//*[@id='ctl44_tblDateRange']/tbody/tr/td[1]/span[2]");
	public final static By RSSAR_INPUT_START_DATE = By.id("ctl44_dteStartDate_txtDatePart");
	public final static By RSSAR_IMG_START_DATE = By.id("ctl44_dteStartDate_imgDateCalendar");
	public final static By RSSAR_DIV_START_DATE_CLOSE = By.id("ctl44_dteStartDate_txtDatePart_CalendarExtender_close");
	public final static By RSSAR_INPUT_END_DATE = By.id("ctl44_dteEndDate_txtDatePart");
	public final static By RSSAR_IMG_END_DATE = By.id("ctl44_dteEndDate_imgDateCalendar");
	public final static By RSSAR_DIV_END_DATE_CLOSE = By.id("ctl44_dteEndDate_txtDatePart_CalendarExtender_close");
	public final static By RSSAR_INPUT_SUBMIT = By.id("ctl44_btnDateRange");
	
	public final static By RSSAR_SPAN_HEADER = By.id("ctl44_Report_Header_lblHeader");
	
	public final static By RSSAR_IMG_REPORT_PREFERENCES = By.id("ctl44_Report_Header_imgPreferences");
	public final static By RSSAR_IMG_EXPORT = By.id("ctl44_Report_Header_imgExcelExport");
	
	public final static By RSSAR_TD_PAGE = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[4]/tbody/tr/td[1]");
	public final static By RSSAR_SPAN_PAGE_START_NO = By.id("ctl44_Report_PagingTop_lblPagingPageNumber");
	public final static By RSSAR_TD_OF = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[4]/tbody/tr/td[3]");
	public final static By RSSAR_SPAN_PAGE_COUNT = By.id("ctl44_Report_PagingTop_lblPagingPageCount");
	
	public final static By RSSAR_INPUT_FIRST = By.id("ctl44_Report_PagingTop_imgFirst");
	public final static By RSSAR_INPUT_PREVIOUS = By.id("ctl44_Report_PagingTop_imgPrevious");
	public final static By RSSAR_INPUT_NEXT = By.id("ctl44_Report_PagingTop_imgNext");
	public final static By RSSAR_INPUT_LAST = By.id("ctl44_Report_PagingTop_imgLast");
	
	public final static By RSSAR_IMG_FILTER_0 = By.id("ctl44_Report_filter_0");
	public final static By RSSAR_IMG_FILTER_1 = By.id("ctl44_Report_filter_1");
	public final static By RSSAR_IMG_FILTER_2 = By.id("ctl44_Report_filter_2");
	public final static By RSSAR_IMG_FILTER_3 = By.id("ctl44_Report_filter_3");
	public final static By RSSAR_IMG_FILTER_4 = By.id("ctl44_Report_filter_4");
	public final static By RSSAR_IMG_FILTER_5 = By.id("ctl44_Report_filter_5");
	public final static By RSSAR_IMG_FILTER_6 = By.id("ctl44_Report_filter_6");
	public final static By RSSAR_IMG_FILTER_7 = By.id("ctl44_Report_filter_7");
	public final static By RSSAR_IMG_FILTER_8 = By.id("ctl44_Report_filter_8");
	public final static By RSSAR_IMG_FILTER_9 = By.id("ctl44_Report_filter_9");
	public final static By RSSAR_IMG_FILTER_95 = By.id("ctl44_Report_filter_95");
	public final static By RSSAR_IMG_FILTER_91 = By.id("ctl44_Report_filter_91");
	public final static By RSSAR_IMG_FILTER_92 = By.id("ctl44_Report_filter_92");
	public final static By RSSAR_IMG_FILTER_10 = By.id("ctl44_Report_filter_1");
	public final static By RSSAR_IMG_FILTER_11 = By.id("ctl44_Report_filter_11");
	public final static By RSSAR_IMG_FILTER_12 = By.id("ctl44_Report_filter_12");
	public final static By RSSAR_IMG_FILTER_13 = By.id("ctl44_Report_filter_13");
	public final static By RSSAR_IMG_FILTER_14 = By.id("ctl44_Report_filter_14");
	public final static By RSSAR_IMG_FILTER_145 = By.id("ctl44_Report_filter_145");
	public final static By RSSAR_IMG_FILTER_15 = By.id("ctl44_Report_filter_15");
	public final static By RSSAR_IMG_FILTER_16 = By.id("ctl44_Report_filter_16");
	public final static By RSSAR_IMG_FILTER_17 = By.id("ctl44_Report_filter_17");
	public final static By RSSAR_IMG_FILTER_18 = By.id("ctl44_Report_filter_18");
	public final static By RSSAR_IMG_FILTER_19 = By.id("ctl44_Report_filter_19");
	public final static By RSSAR_IMG_FILTER_20 = By.id("ctl44_Report_filter_20");
	public final static By RSSAR_IMG_FILTER_205 = By.id("ctl44_Report_filter_205");
	public final static By RSSAR_IMG_FILTER_21 = By.id("ctl44_Report_filter_21");
	public final static By RSSAR_IMG_FILTER_22 = By.id("ctl44_Report_filter_22");
	public final static By RSSAR_IMG_FILTER_225 = By.id("ctl44_Report_filter_225");
	public final static By RSSAR_IMG_FILTER_23 = By.id("ctl44_Report_filter_23");
	public final static By RSSAR_IMG_FILTER_24 = By.id("ctl44_Report_filter_24");
	public final static By RSSAR_TH_SRO = By.id("ctl44_Report_sort_0");
	public final static By RSSAR_TH_INCIDENT = By.id("ctl44_Report_sort_1");
	public final static By RSSAR_TH_CONTRACT = By.id("ctl44_Report_sort_2");
	public final static By RSSAR_TH_INC_DATE = By.id("ctl44_Report_sort_3");
	public final static By RSSAR_TH_CREATE_DATE = By.id("ctl44_Report_sort_4");
	public final static By RSSAR_TH_CLOSE_DATE = By.id("ctl44_Report_sort_5");
	public final static By RSSAR_TH_DESCRIPTION = By.id("ctl44_Report_sort_6");
	public final static By RSSAR_TH_ITEM = By.id("ctl44_Report_sort_7");
	public final static By RSSAR_TH_NOTES = By.id("ctl44_Report_sort_8");
	public final static By RSSAR_TH_SHIP_TO_CITY = By.id("ctl44_Report_sort_9");
	public final static By RSSAR_TH_STATE = By.id("ctl44_Report_sort_95");
	public final static By RSSAR_TH_ADDRESS_1 = By.id("ctl44_Report_sort_91");
	public final static By RSSAR_TH_ADDRESS_2 = By.id("ctl44_Report_sort_92");
	public final static By RSSAR_TH_ASSIGNED_TO = By.id("ctl44_Report_sort_10");
	public final static By RSSAR_TH_WHSE = By.id("ctl44_Report_sort_11");
	public final static By RSSAR_TH_RSM = By.id("ctl44_Report_sort_12");
	public final static By RSSAR_TH_SRO_TYPE = By.id("ctl44_Report_sort_13");
	public final static By RSSAR_TH_PRIORITY = By.id("ctl44_Report_sort_14");
	public final static By RSSAR_TH_ASSET_NAME = By.id("ctl44_Report_sort_145");
	public final static By RSSAR_TH_ASSET_DESC = By.id("ctl44_Report_sort_15");
	public final static By RSSAR_TH_SERIAL_NUMBER = By.id("ctl44_Report_sort_16");
	public final static By RSSAR_TH_SVC_PARTNER = By.id("ctl44_Report_sort_17");
	public final static By RSSAR_TH_CUSTOMER = By.id("ctl44_Report_sort_18");
	public final static By RSSAR_TH_INC_STATUS = By.id("ctl44_Report_sort_19");
	public final static By RSSAR_TH_SRO_STATUS = By.id("ctl44_Report_sort_20");
	public final static By RSSAR_TH_MFG = By.id("ctl44_Report_sort_205");
	public final static By RSSAR_TH_ASSET_TYPE = By.id("ctl44_Report_sort_21");
	public final static By RSSAR_TH_CUST_TICKET_NO = By.id("ctl44_Report_sort_22");
	public final static By RSSAR_TH_CUST_P_O = By.id("ctl44_Report_sort_225");
	public final static By RSSAR_TH_SLA = By.id("ctl44_Report_sort_23");
	public final static By RSSAR_TH_RESOLUTION = By.id("ctl44_Report_sort_24");
	
	public static void enterReportsSMSServiceActivityReportPage(){
		SpHomePageUtil.enter();
		SpHomePageUtil.enterReportsDefaultPage();
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpReportsDefaultPageUtil.RD_LINK_SERVICE_ACTIVITY_REPORT));
		waitForPageToLoad();
	}
	
	public static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_REPORTS_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				RSSAR_IMG_EXPORT, RSSAR_INPUT_FIRST, RSSAR_INPUT_PREVIOUS, RSSAR_INPUT_NEXT,RSSAR_INPUT_LAST, 
				RSSAR_IMG_FILTER_0, RSSAR_IMG_FILTER_1, RSSAR_IMG_FILTER_2, RSSAR_IMG_FILTER_3, RSSAR_IMG_FILTER_4, RSSAR_IMG_FILTER_5, 
				RSSAR_IMG_FILTER_6, RSSAR_IMG_FILTER_7, RSSAR_IMG_FILTER_8, RSSAR_IMG_FILTER_9, RSSAR_IMG_FILTER_10, RSSAR_IMG_FILTER_11, 
				RSSAR_IMG_FILTER_12, RSSAR_IMG_FILTER_13, RSSAR_IMG_FILTER_14, RSSAR_IMG_FILTER_15, RSSAR_IMG_FILTER_16, RSSAR_IMG_FILTER_17, 
				RSSAR_IMG_FILTER_18, RSSAR_IMG_FILTER_19, RSSAR_IMG_FILTER_20, RSSAR_IMG_FILTER_21, RSSAR_IMG_FILTER_22, RSSAR_IMG_FILTER_23, 
				RSSAR_IMG_FILTER_24, RSSAR_IMG_FILTER_225, RSSAR_IMG_FILTER_205, RSSAR_IMG_FILTER_145, RSSAR_IMG_FILTER_92, RSSAR_IMG_FILTER_91, 
				RSSAR_IMG_FILTER_95,RSSAR_IMG_START_DATE, RSSAR_IMG_END_DATE, RSSAR_INPUT_SUBMIT
			});
//		SmsSeleniumUtil.isDisplayed(SmsSeleniumUtil.findElement(RSSAR_IMG_REPORT_PREFERENCES));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_EXPORT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_INPUT_FIRST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_INPUT_PREVIOUS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_INPUT_NEXT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_INPUT_LAST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_0));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_1));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_2));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_3));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_4));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_5));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_6));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_7));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_8));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_9));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_10));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_11));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_12));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_13));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_14));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_15));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_16));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_17));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_18));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_19));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_20));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_21));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_22));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_23));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_24));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_225));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_205));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_92));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_91));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_FILTER_95));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_START_DATE));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_IMG_END_DATE));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSSAR_INPUT_SUBMIT));
	}
}
